package com.kingdee.eas.hr.quali.handler;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.kingdee.bos.Context;
import com.kingdee.eas.basedata.org.StateEnum;
import com.kingdee.eas.framework.CoreBaseInfo;
import com.kingdee.eas.hr.quali.QualificationsFamilyInfo;
import com.kingdee.eas.util.app.ContextUtil;
import com.kingdee.shr.base.syssetting.context.SHRContext;
import com.kingdee.shr.base.syssetting.exception.SHRWebException;
import com.kingdee.shr.base.syssetting.web.handler.EditHandler;

public class QualificationsFamilyEditHandler extends EditHandler{

	@Override
	protected void beforeSave(HttpServletRequest request, HttpServletResponse response, CoreBaseInfo model)throws SHRWebException {
		super.beforeSave(request, response, model);
		Context ctx = SHRContext.getInstance().getContext();
		QualificationsFamilyInfo info = (QualificationsFamilyInfo) model;
		if(info.getHrOrgUnit() == null){
			info.setHrOrgUnit(ContextUtil.getCurrentHRUnit(ctx));
		}
		if(info.getState() == null){
			info.setState(StateEnum.DISABLE);
		}
	}
	
	
}
